<?php
namespace app\webapp\controller;
use think\Controller;
use mylib\Jssdk;

class Wei extends Controller
{
    protected function initialize()
    {
        $jssdk = new Jssdk("wxa356ba6c939fc2c1", "7941b1ec920c3f42b28b50facb958d38");
        $signature = $jssdk->GetSignPackage();
        $this->assign("signature", $signature);
    }

    public function index()
    {


//        $varieties = db('varieties')->select();
//
//        $data = [
//            'signPackage' => $signPackage,
//            'varieties' => $varieties
//        ];
//
//        $this->assign($data);
        return view('index/index_weui');
    }

    public function weui()
    {
        $news = [
            ["id"=>100, "title"=>"news 01"],
            ["id"=>200, "title"=>"news 02"],
            ["id"=>300, "title"=>"news 03"],
        ];

        $this->assign("news", $news);
        return view('index/index_index');
    }
}
